<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!--  number：转化为数值
        trim:去掉首尾空格
        lazy：将input事件切换为change事件 -->
        <input type="text" name="" id="" v-model.number='age'>
        <button @click="handle">点击</button>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                age:''
            },
            methods: {
                handle:function(){
                    console.log(this.age + 21);
                }
            },
        })
    </script>
</body>
</html>